package servlet;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import utils.msg.ComplexPollingRunnable;
import utils.msg.PollingQueryRunnable;


@WebListener
public class InitServlet implements ServletContextListener {  
	 
	public InitServlet() {
		super();
	}

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		
	}

	
	
	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		ServletContext application = arg0.getServletContext();
		Map<Integer, ComplexPollingRunnable> map = new HashMap<Integer, ComplexPollingRunnable>();
		application.setAttribute("map", map);
	}
	
	public void oldContextInitialized(ServletContextEvent arg0) {
		ServletContext application = arg0.getServletContext();
		Map<Integer, PollingQueryRunnable> map = new HashMap<Integer, PollingQueryRunnable>();
		application.setAttribute("map", map);
	}
	
} 